<template>
	<div class="w-100">
		<div class="tabs-content" v-if="!showResult">
			<el-scrollbar max-height="80vh">
				<BaseInfo ref="formRef" @refresh="onRefresh" @back="handleBack"></BaseInfo>
			</el-scrollbar>
			<div class="fc">
				<el-button class="ap-btn" type="primary" @click="handleSubmit('submit')"> 保存 </el-button>
			</div>
		</div>
		<DataGather v-else :dataType="6" :gatherObj="gatherObj" @back="handleBack" @init="getInitMod"></DataGather>
	</div>
</template>

<script setup lang="ts">
import BaseInfo from './BaseInfo/index.vue'
import DataGather from '@/views/datacenter/components/DataGather/result.vue'

const emit = defineEmits(['refresh'])
const formRef = ref(null)
// 采集信息
const gatherObj: any = ref({})
const showResult = ref(false)
const getInitMod = () => {
	showResult.value = false
}
const onRefresh = (item) => {
	gatherObj.value = item || {}
	showResult.value = true
}
const handleSubmit = (type) => {
	formRef.value!.onSave()
}
const handleBack = () => {
	emit('refresh')
}
</script>

<style scoped lang="scss"></style>
